// 引入 request 文件
import request from '@/utils/base.js'
// 文件拼接地址
export const fileLinkUrl = 'https://api2.aimlt.com/ai/task/exec'  // 线上环境
// export const fileLinkUrl = 'https://test-api2.aimlt.com/ai/task/exec' // 测试环境

// 获取主播类型列表
export function pubTypeList(data) {
	return request({
		method: 'POST',
		url: '/ai/cgibin/getServerInfo',
		data,
		type: 2
	})
}

// 获取主播列表
export function pubList(data) {
	return request({
		method: 'POST',
		url: '/ai/tts/lists',
		data,
		type: 2
	})
}

// 获取主播详情
export function pubDetail(data) {
	return request({
		method: 'POST',
		url: '/ai/tts/info',
		data,
		type: 2
	})
}

// 获取合成配音
export function pubFit(data) {
	return request({
		method: 'POST',
		url: '/ai/tts/textToSpeech',
		data,
		type: 2
	})
}

// 获取合成配音
export function collect(data) {
	return request({
		method: 'POST',
		url: '/ai/user/collect',
		data,
		type: 2
	})
}

// 添加搜藏
export function addCollect(data) {
	return request({
		method: 'POST',
		url: '/ai/user/addCollect',
		data,
		type: 2
	})
}

// 取消搜藏
export function cancelCollect(data) {
	return request({
		method: 'POST',
		url: '/ai/user/delCollect',
		data,
		type: 2
	})
}

// AI创作列表
export function createList(data) {
	return request({
		method: 'POST',
		url: '/ai/product/creationlists',
		data,
		type: 2
	})
}
// AI创作提交
export function aiSubmit(data) {
	return request({
		method: 'POST',
		url: '/ai/product/creation',
		data,
		type: 2
	})
}
//AI问答
export function aiAnswer(data) {
	return request({
		url: '/ai/creation/startSession',
		method: 'POST',
		data,
		type: 2
	})
}

//创建对话
export function createDialog(data) {
	return request({
		url: '/ai/creation/session',
		method: 'POST',
		data,
		type: 2
	})
}

//历史对话列表
export function dialogList(data) {
	return request({
		url: '/ai/creation/sessionlist',
		method: 'POST',
		data,
		type: 2
	})
}

//清空对话
export function cleanDialog(data) {
	return request({
		url: '/ai/creation/sessiondelete',
		method: 'POST',
		data,
		type: 2
	})
}

//清空对话
export function aiModel(data) {
	return request({
		url: '/ai/tts/ttsConfig',
		method: 'POST',
		data,
		type: 2
	})
}

//清空对话
export function audioData(data) {
	return request({
		url: '/ai/tts/getFileUrl',
		method: 'POST',
		data,
		type: 2
	})
}

//配音历史记录
export function dubList(data) {
	return request({
		url: '/ai/tts/getUserSpeechList',
		method: 'POST',
		data,
		type: 2
	})
}